<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%--jstl을 쓰기 위해 사용 --%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %><%--숫자 포맷을 사용하기 위해 사용 --%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"  prefix="fn"%><%--함수들을 이용하기 위해 사용 --%>    
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="reset.css" rel="stylesheet" type="text/css" />
<link href="style.css" rel="stylesheet" type="text/css" />
<!--말 줄임 css(모든 브라우저 적용)-->
<style type="text/css">
.ellipsis{
	white-space:nowrap;
	text-overflow:ellipsis;		/* IE, Safari */
	-o-text-overflow:ellipsis;		/* Opera under 10.7 */
	overflow:hidden;			/* "overflow" value must be different from "visible" */ 
	-moz-binding: url('ellipsis.xml#ellipsis');
}
</style>
<script type="text/javascript" src="script/sms_util_script.js"></script>
<script type="text/javascript">
function choiceData(base_id,base_lev1,base_lev2){
	//alert(base_id);
	var flag=confirm("선택하시겠습니까?");
	if(flag){
		if(base_id=="tk_type"){
			opener.document.getElementById("base_lev1").value=base_lev1;
			opener.document.getElementById("tk_type").value=base_lev2;
			opener.document.getElementById("tk_nm").focus();
		}else if(base_id="ak_type"){
			opener.document.getElementById("base_lev1").value=base_lev1;
			opener.document.getElementById("ak_type").value=base_lev2;
			opener.document.getElementById("ak_standard").focus();
		}
	window.close();
	}else {
		return false;
	}
}
function winClose(){
	window.close();
}
</script>
</head>
<body>

<c:if test="${sessionScope.USER_ID==null}">
		<script type="text/javascript">
			alert("연결이 끊어졌습니다. 다시 로그인 해주시기 바랍니다");
			window.close();
		</script>	
</c:if>
<div class="box">
	<div class="box-container1">     		
        	<table class="table-short1" style="margin: 0 auto; width: 200px">
      			<tfoot>
      				<tr>
      					<td>
      						<div class="align-left">
      							<a href="#" class="button1">
      								<span>
      								<c:choose>
										<c:when test="${requestScope.base_id=='ak_type'}">
											자산유형선택
										</c:when>
										<c:when test="${requestScope.base_id=='tk_type'}">
											위협유형선택
										</c:when>
									</c:choose>
									</span>
								</a>
							</div>
                        	<div class="align-right"><a href="#" class="button" onclick="javascript: winClose()"><span>닫기</span></a></div>
                        </td>
      				</tr>
      				<tr><td class="spaceLine"></td></tr>
      			</tfoot>
      		</table>
      		<table class="table-short1" style="margin: 0 auto; width: 200px">
      			<colgroup>
					<col width="40px"/>
					<col/>
					<col width="15px"/>
				</colgroup>
      			<thead>
      				<tr>
      					<td></td>
      					<td>
	      					<c:choose>
								<c:when test="${requestScope.base_id=='ak_type'}">
									자산유형
								</c:when>
								<c:when test="${requestScope.base_id=='tk_type'}">
									위협유형
								</c:when>
							</c:choose>
      					</td>
      					<td></td>
      				</tr>
      			</thead>
      		</table>
      		<div class="scrollDIV" style="width: 200px; height: 226px;">
      		<table class="table-short1" style="margin: 0 auto; width: 200px">
      			<colgroup>
      				<col width="40px"/>
					<col/>
					<col width="15px"/>
				</colgroup>
      			<tbody>
      				<c:choose>
                    	<c:when test="${fn:length(blist)!= 0}">
                    		<c:forEach var="blist" items="${requestScope.blist}" varStatus="status">
	                    		 <tr <c:if test="${status.index%2==0 }">class="odd"</c:if> onmouseover="ChangeBackground(this,'over','${status.index}');" onmouseout="ChangeBackground(this,'out','${status.index}');">
	                    			<td><input type="radio" name="choice" id="choice" onclick="choiceData('${requestScope.base_id }','${blist.base_lev1}','${blist.base_lev2 }')"></input></td>
	                    			<td>
	                    				<div class="ellipsis"  style="width:100%;" title="${blist.base_lev2 }">${blist.base_lev2 }</div>
	                    			</td>
		   					 	<td></td>
	                    		</tr>
	                    	</c:forEach>
                    	</c:when>
                    	<c:otherwise>
                    		<tr class="odd">
								<td class="noDataTD" colspan="3">-데이터가 없습니다-</td>
							</tr>
                    	</c:otherwise>
                   	</c:choose>
      			</tbody>
      		</table>  	
      		</div>
      	</div><!-- end of div.box-container1 -->
</div> <!-- end of div.box -->
</body>
</html>